Add gbtypes.h to (help) solve problem on Alpha.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 3 Feb 2005 21:55:46 +0000 (21:55 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 3 Feb 2005 21:55:46 +0000 (21:55 +0000)
gpsbabel/defs.h
gpsbabel/gbtypes.h [new file with mode: 0644]
gpsbabel/saroute.c

index f4d520907b07630e9a36cb7d05b31f2c6a71f4a0..7afd45e802118dde5e496f748ac02f8e25e55fc1 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdarg.h>
 #include <stddef.h>
 #include "queue.h"
+#include "gbtypes.h"
 
 
 /*
diff --git a/gpsbabel/gbtypes.h b/gpsbabel/gbtypes.h
new file mode 100644 (file)
index 0000000..b8d5b77
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+    Abstract fixed size data types.
+
+    Copyright (C) 2005 Robert Lipe, robertlipe@usa.net
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+
+/*
+ *  If this is a problem and any interesting system doesn't have the C99-ism
+ *  of <stdint.h> we'll come up with something more clever that'll likely
+ *  include a gross collection of  __STDC_VERSION >= 199901L  || __GNUC__
+ */
+
+
+#include <stdint.h>
+
+typedef uint32_t       gbuint32;
+typedef uint16_t       gbuint16;
+typedef  int32_t        gbint32;
+typedef  int16_t        gbint16;
index 4bc5faca8b8b8ee1427c794d2e96c685487cedf1..11dc7f29a9487aadf15968a5bca58c158dc60ed2 100644 (file)
@@ -44,7 +44,7 @@ arglist_t saroute_args[] = {
 unsigned short
 ReadShort(FILE * f)
 {
-       unsigned short result = 0;
+       gbuint16 result = 0;
 
        fread(&result, sizeof (result), 1, f);
        return le_read16(&result);
@@ -53,7 +53,7 @@ ReadShort(FILE * f)
 unsigned long
 ReadLong(FILE * f)
 {
-       unsigned long result = 0;
+       gbuint32 result = 0;
 
        fread(&result, sizeof (result), 1, f);
        return le_read32(&result);
@@ -100,8 +100,8 @@ my_read(void)
        unsigned char *record;
        static int serial = 0;
        struct ll {
-               long lat;
-               long lon;
+               gbint32 lat;
+               gbint32 lon;
        } *latlon;
        unsigned short coordcount;
        route_head *track_head;
@@ -250,7 +250,7 @@ my_read(void)
                                }
                        }
                        if ( version > 10 ) {
-                               Skip(infile,2*sizeof(long));
+                               Skip(infile,2*sizeof(gbuint32));
                        }
                        xfree(record);
                }